<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use DB;
use App\Http\Requests;
use App\Http\Controllers\Controller;

class JingsListController extends Controller
{
    /*
        品类精选促销查询
    */
    public static function getJings()
    {
        //查询
        $good1 = DB::table('goods')->where('cid','=',10)->first();
        $jings[0] = $good1;
        $good2 = DB::table('goods')->where('cid','=',12)->first();
        $jings[1] = $good2;
        $good3 = DB::table('goods')->where('cid','=',14)->first();
        $jings[2] = $good3;
        $good4 = DB::table('goods')->where('cid','=',16)->first();
        $jings[3] = $good4;
        $good5 = DB::table('goods')->where('cid','=',17)->first();
        $jings[4] = $good5;
        // dd($jings);
        //解析模板
        return view('Home.jings.jingslist',['jings'=> $jings]);
    }
    /*
        全球尖货查询
    */
    public static function getJians()
    {
        //查询
        $jians = DB::table('goods')->get();
        // dd($jians);
        //解析模板
        return view('Home.jings.jianslist',['jians'=> $jians]);
    }
}
